import request from '@/utils/request'

// 创建生产班次
export function createShift(data) {
  return request({
    url: '/lamp/shift/create',
    method: 'post',
    data: data
  })
}

// 更新生产班次
export function updateShift(data) {
  return request({
    url: '/lamp/shift/update',
    method: 'put',
    data: data
  })
}

// 删除生产班次
export function deleteShift(id) {
  return request({
    url: '/lamp/shift/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除生产班次 */
export function deleteShiftList(ids) {
  return request({
    url: `/lamp/shift/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得生产班次
export function getShift(id) {
  return request({
    url: '/lamp/shift/get?id=' + id,
    method: 'get'
  })
}

// 获得生产班次分页
export function getShiftPage(params) {
  return request({
    url: '/lamp/shift/page',
    method: 'get',
    params
  })
}
// 导出生产班次 Excel
export function exportShiftExcel(params) {
  return request({
    url: '/lamp/shift/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}